# -*- coding: utf-8 -*-
"""
main
2025/10/9
@author: zhangzida
"""
import time
from base.base import Base
class page_role_permission_selectpermission(Base):
    def role_permission_selectpermission(self,name,number,desc,op_name,op_login_name,op_login_pwd,op_phone,op_desc):
        self.switch_node("role_management")
        self.logger.info('点击角色管理')
        self.click("role_manage")
        self.logger.info('点击添加角色')
        self.click('add_role')
        self.logger.info('输入角色名称')
        self.send_keys("role_name",name)
        self.logger.info('输入角色编码')
        self.send_keys("role_coding",number)
        self.logger.info('输入角色描述')
        self.send_keys("role_desc",desc)
        self.logger.info("点击保存")
        self.click("role_save")
        time.sleep(5)
        self.logger.info('点击分配权限')
        self.click("assign_permissions")
        self.logger.info('点击选择权限1')
        self.click("permissions_1")
        self.logger.info('点击选择权限2')
        self.click("permissions_2")
        self.logger.info('点击权限保存')
        self.click("assign_permission_save")
        self.logger.info('点击操作员管理')
        self.click("op_manage")
        self.logger.info('点击添加操作员')
        self.click("op_add")
        self.logger.info('输入操作员姓名')
        self.send_keys("op_name",op_name)
        self.logger.info('输入操作员登录名')
        self.send_keys("op_login_name",op_login_name)
        self.logger.info('输入密码')
        self.send_keys("op_login_pwd",op_login_pwd)
        self.logger.info('输入手机号')
        self.send_keys("op_phone",op_phone)
        self.logger.info('选择状态')
        self.click("op_login_status")
        self.logger.info('选择激活')
        self.click("op_activated")
        self.logger.info('描述')
        self.send_keys("op_desc",op_desc)
        self.logger.info('绑定角色')
        self.click("op_user")
        self.logger.info('选择保存')
        self.click("op_save")